<include file="Public/min-header"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--物流配置 css -start-->
<style>
    ul.group-list {
        width: 96%;min-width: 1000px; margin: auto 5px;list-style: disc outside none;
    }
    ul.group-list li {
        white-space: nowrap;float: left;
        width: 150px; height: 25px;
        padding: 3px 5px;list-style-type: none;
        list-style-position: outside;border: 0px;margin: 0px;
    }
</style>
<!--物流配置 css -end-->



<script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="__ROOT__/Public/plugins/Ueditor/lang/zh-cn/zh-cn.js"></script>

<!--以上是在线编辑器 代码  end-->
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
                <a href="javascript:;" class="btn btn-default" data-url="http://www.tp-shop.cn/Doc/Index/article/id/1007/developer/user.html" onclick="get_help(this)"><i class="fa fa-question-circle"></i> 帮助</a>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i>代理商返利规则详情</h3>
                </div>
                <div class="panel-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_tongyong" data-toggle="tab">通用信息</a></li>
                    </ul>
                    <!--表单数据-->
                    <form method="post" id="addEditRebateConfigForm">

                        <!--通用信息-->
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab_tongyong">

                                <table class="table table-bordered">
                                    <tbody>
                                    <!--<tr>-->
                                        <!--<td>商品名称:</td>-->
                                        <!--<td>-->
                                            <!--<input type="text" value="{$goodsInfo.goods_name}" name="goods_name" class="form-control" style="width:550px;"/>-->
                                            <!--<span id="err_goods_name" style="color:#F00; display:none;"></span>-->
                                        <!--</td>-->
                                    <!--</tr>-->
                                    <!--<tr>-->
                                        <!--<td>领取要运费的描述:</td>-->
                                        <!--<td>-->
                                            <!--<input type="text" value="{$goodsInfo.action_1}" name="action_1" class="form-control" style="width:550px;"/>-->
                                            <!--<span id="err_action_1" style="color:#F00; display:none;"></span>-->
                                        <!--</td>-->
                                    <!--</tr>-->

                          <!--          CREATE TABLE tp_rebate_config
                                    (
                                    id MEDIUMINT(8) PRIMARY KEY AUTO_INCREMENT,
                                    start_money DECIMAL(10,2) DEFAULT 0 COMMENT '满足该条返利的最低销售额',
                                    end_money DECIMAL(10, 2) DEFAULT 0 NOT NULL COMMENT '满足该条返利最高销售额',
                                    rebate_ratio FLOAT DEFAULT 0 COMMENT '返利比例'
                                    )ENGINE=InnoDB DEFAULT CHARSET=utf8;-->
                                    <tr>
                                        <td>该档位最小金额:</td>
                                        <td>
                                            <input type="text" value="{$goodsInfo.start_money}" name="start_money" class="form-control" style="width:550px;"/>
                                            <span id="err_action_2" style="color:#F00; display:none;"></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>该档位最大金额:</td>
                                        <td>
                                            <input type="text" value="{$goodsInfo.end_money}" name="end_money" class="form-control" style="width:550px;"/>
                                            <span id="err_action_2" style="color:#F00; display:none;"></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>该档位返利比例:</td>
                                        <td>
                                            <input type="text" value="{$goodsInfo.rebate_ratio}" name="rebate_ratio" class="form-control" style="width:550px;"/>
                                            <span id="err_action_2" style="color:#F00; display:none;"></span>
                                        </td>
                                    </tr>

                        <!--            <tr>
                                        <td>商品简介:</td>
                                        <td>
                                            <textarea rows="3" cols="80" name="goods_remark">{$goodsInfo.goods_remark}</textarea>
                                            <span id="err_goods_remark" style="color:#F00; display:none;"></span>

                                        </td>
                                    </tr>-->


              <!--                      <tr>
                                        <td>商品所属省份:</td>
                                        <td>
                                            <div class="col-xs-3">
                                                <select name="region_id" id="region_id"  class="form-control" style="width:250px;margin-left:-15px;">
                                                    <option value="0">请选择省份</option>
                                                    <foreach name="regionList" item="v" key="k" >
                                                        <option value="{$v['id']}" <if condition="$v['id'] eq $goodsInfo['region_id']">selected="selected"</if> >
                                                        {$v['name']}
                                                        </option>
                                                    </foreach>
                                                </select>
                                            </div>
                          &lt;!&ndash;                  <div class="col-xs-3">
                                                <select name="region_id_2" id="region_id_2"  class="form-control" style="width:250px;margin-left:-15px;">
                                                    <option value="0">请选择城市分类</option>
                                                </select>
                                            </div>
                                            <span id="err_region_id" style="color:#F00; display:none;"></span>&ndash;&gt;
                                        </td>
                                    </tr>-->
                                    </tbody>
                                </table>
                            </div>
                            <!--其他信息-->

                        </div>
                        <div class="pull-right">
                            <input type="hidden" name="id" value="{$goodsInfo.id}">
                            <button class="btn btn-primary" onclick="ajax_submit_form('addEditRebateConfigForm','{:U('RebateConfig/addEditRebateConfig?is_ajax=1')}');" title="" data-toggle="tooltip" type="button" data-original-title="保存">保存</button>
                        </div>
                    </form><!--表单数据-->
                </div>
            </div>
        </div>    <!-- /.content -->
    </section>
</div>
<script>

    /*
     * 以下是图片上传方法
     */
    // 上传商品图片成功回调函数
    function call_back(fileurl_tmp){
        $("#image1").val(fileurl_tmp);
        $("#image3").attr('href', fileurl_tmp);
    }



    function call_back3(fileurl_tmp)
    {
        $("#image2").val(fileurl_tmp);
        $("#image4").attr('href', fileurl_tmp);

    }
    // 上传商品相册回调函数
    function call_back2(paths){

        var  last_div = $(".goods_xc:last").prop("outerHTML");
        for (i=0;i<paths.length ;i++ )
        {
            $(".goods_xc:eq(0)").before(last_div);	// 插入一个 新图片
            $(".goods_xc:eq(0)").find('a:eq(0)').attr('href',paths[i]).attr('onclick','').attr('target', "_blank");// 修改他的链接地址
            $(".goods_xc:eq(0)").find('img').attr('src',paths[i]);// 修改他的图片路径
            $(".goods_xc:eq(0)").find('a:eq(1)').attr('onclick',"ClearPicArr2(this,'"+paths[i]+"')").text('删除');
            $(".goods_xc:eq(0)").find('input').val(paths[i]); // 设置隐藏域 要提交的值
        }
    }
    /*
     * 上传之后删除组图input
     * @access   public
     * @val      string  删除的图片input
     */
    function ClearPicArr2(obj,path)
    {
        $.ajax({
            type:'GET',
            url:"{:U('Admin/Uploadify/delupload')}",
            data:{action:"del", filename:path},
            success:function(){
                $(obj).parent().remove(); // 删除完服务器的, 再删除 html上的图片
            }
        });
        // 删除数据库记录
        $.ajax({
            type:'GET',
            url:"{:U('Admin/Goods/del_goods_images')}",
            data:{filename:path},
            success:function(){
                //
            }
        });
    }



</script>
</body>
</html>